﻿@using System.Data
@{
    Layout = null;
    DataTable dt1 = ViewBag.DT1 as DataTable;
    DataTable dt2 = ViewBag.DT2 as DataTable;
    DataTable dtts = ViewBag.DTTS as DataTable;
    DataTable dtbqhzhs = ViewBag.DTBQHZHS as DataTable;
    DataTable dthzhz = ViewBag.DTHZHZ as DataTable;
    DataTable dtfxpg = ViewBag.DTFXPG as DataTable;
    DataTable dtyyff = ViewBag.DTYYFF as DataTable;
    string patientsArray = "";
    for (int i = 0; i < dtbqhzhs.Rows.Count; i++)
    {
        patientsArray += "{\"name\":\"\",\"value\":" + (dtbqhzhs.Rows[i]["PATIENT_NUM"].ToString()) + "},";
    }
    if (patientsArray.Length > 0)
    {
        patientsArray = patientsArray.Substring(0, patientsArray.Length - 1);
    }
    string nurseCellArray = "";
    for (int i = 0; i < dtbqhzhs.Rows.Count; i++)
    {
        nurseCellArray += "\"" + (dtbqhzhs.Rows[i]["NURSE_CELL_NAME"].ToString()) + "\",";
    }
    if (nurseCellArray.Length > 0)
    {
        nurseCellArray = nurseCellArray.Substring(0, nurseCellArray.Length - 1);
    }
}
<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>首页</title>
    <link href="~/lib/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet" type="text/css" />
    <link href="~/lib/ligerUI/skins/ligerui-icons.css" rel="stylesheet" type="text/css" />
    <link href="~/lib/ligerUI/skins/Gray/css/all.css" rel="stylesheet" type="text/css" />
    <link href="~/Content/css/common.css" rel="stylesheet" type="text/css" />
    <script src="~/lib/jquery/jquery-1.9.0.min.js" type="text/javascript"></script>
    <script src="~/lib/ligerUI/js/ligerui.all.js"></script>
    <script src="~/Scripts/common.js"></script>
    <script src="~/Scripts/echarts.min.js" type="text/javascript"></script>
    <link type="text/css" rel="stylesheet" href="/content/css/desktop.css" />
    <style>
    a{color:#999;text-decoration:none;}
    ul{list-style:none;}
    body{padding:0;background-color:#f7f7f7;}
    .bg-grey{width:100%;height:100%;}
    .content{width:100%;height:100%;}
    .tab-block{width:100%;height:100%;border:1px solid #e5e5e5;background-color:#fff;}
    .tab-block.information-tab .tabs{width:100%;height:100%;}
    .tab-block .tab-buttons{width:100%;height:35px;background-color:#f2f2f3;}
    .tab-block .tab-buttons .tab-button{position:relative;float:left;width:120px;height:35px;background-color:#f2f2f3;color:#999;text-align:center;font-size:14px;line-height:35px;cursor:pointer;}
    .tab-block .tab-buttons .tab-button.cur{background-color:#fff;color:#333;}
    .tab-block .tab-buttons .tab-button.cur:after{position:absolute;top:-1px;left:0;width:100%;height:2px;background-color:#1183ff;content:'';}   
    </style>
    <script type="text/javascript">
        $(function () {
            $(".bg-grey").eq(0).height($(window).height() - 5);
            $(".bg-grey").eq(0).width($(window).width() - 5);
            $('.tab-button').click(function () {
                var tab = $(this).data('tab')
                $(this).addClass('cur').siblings('.tab-button').removeClass('cur');
                var index = $(this).attr("tabindex");
                $(".tabs").hide();
                $("#tabs" + index).show();
            });
            $(".tab-button").eq(0).click();
            $("#tabs3 .tab-date").on("click", function () {
                var index = $(this).attr("data-val");
                $(this).addClass('selected').siblings('.tab-date').removeClass('selected');
                $(".hzhz").hide();
                $("#hzhz" + index).show();
            });
            $("#tabs3 .tab-date").eq(0).click();
            $("#tabs5 .tab-date").on("click", function () {
                var index = $(this).attr("data-val");
                $(this).addClass('selected').siblings('.tab-date').removeClass('selected');
                $(".fxpg").hide();
                $("#fxpg" + index).show();
            });
            $("#tabs5 .tab-date").eq(0).click();
            $("#tabs6 .tab-date").on("click", function () {
                var index = $(this).attr("data-val");
                $(this).addClass('selected').siblings('.tab-date').removeClass('selected');
                $(".yyff").hide();
                $("#yyff" + index).show();
            });
            $("#tabs6 .tab-date").eq(0).click();
        });
    </script>
</head>
<body>
    <div class="bg-grey">
        <div class="content">
            <div class="tab-block information-tab">
                <div class="tab-buttons">
                    <h3 class="tab-button cur" tabindex="1">患者总览</h3>
                    <h3 class="tab-button cur" tabindex="2">护士总览</h3>
                    <h3 class="tab-button cur" tabindex="3">患者汇总</h3>
                    <h3 class="tab-button cur" tabindex="4">特殊人群</h3>
                    <h3 class="tab-button cur" tabindex="5">风险评估</h3>
                    <h3 class="tab-button cur" tabindex="6">用药方法</h3>
                </div>
                <div class="tabs" id="tabs1">
                    <div class="div2">
                        <ul class="marginl50" style="margin-left:150px;">
                            <li class="tit1"><label id="lblAeAddCount">@(dt1.Rows[0]["ALL_PATIENT_NUM"].ToString())</label></li>
                            <li class="tit2">病人总数</li>
                        </ul>
                        <ul class="marginl125">
                            <li class="tit1"><label id="lblAeReviewCount">@(dt1.Rows[0]["ALL_NURSING_LEVEL_0"].ToString())</label></li>
                            <li class="tit2">特级病人</li>
                        </ul>
                        <ul class="marginl125">
                            <li class="tit1">@(dt1.Rows[0]["ALL_NURSING_LEVEL_1"].ToString())</li>
                            <li class="tit2">一级病人</li>
                        </ul>
                        <ul class="marginl125">
                            <li class="tit1">@(dt1.Rows[0]["ALL_NURSING_LEVEL_2"].ToString())</li>
                            <li class="tit2">二级病人</li>
                        </ul>
                    </div>
                    <div class="div2" style="margin-top:10px;">
                        <ul class="marginl50">
                            <li class="tit1"><label id="lblAeAddCount">@(dt1.Rows[0]["DAY_IN_HOSPITAL"].ToString())</label></li>
                            <li class="tit2">今日入院</li>
                        </ul>
                        <ul class="marginl125">
                            <li class="tit1"><label id="lblAeReviewCount">@(dt1.Rows[0]["DAY_OUT_HOSPITAL"].ToString())</label></li>
                            <li class="tit2">今日出院</li>
                        </ul>
                        <ul class="marginl125">
                            <li class="tit1">@(dt1.Rows[0]["DAY_OPERATION"].ToString())</li>
                            <li class="tit2">今日手术</li>
                        </ul>
                        <ul class="marginl125">
                            <li class="tit1">@(dt1.Rows[0]["DAY_HEAVILY_ILL"].ToString())</li>
                            <li class="tit2">今日病危</li>
                        </ul>
                        <ul class="marginl125">
                            <li class="tit1">@(dt1.Rows[0]["DAY_CRITICALLY_ILL"].ToString())</li>
                            <li class="tit2">今日病重</li>
                        </ul>
                    </div>
                    <div style="width:100%;margin-left: 6px; margin-top: 10px; background-color: #f0f0f0; border: 1px solid #d4e3e6;">
                        <!-- 为ECharts准备一个具备大小（宽高）的Dom -->
                        <div id="mainecharts" style="height:260px;"></div>                        
                    </div>
                </div>
                <div class="tabs" id="tabs2">
                    <div class="div2">
                        <div style="margin:auto">
                            <ul class="marginl50" style="margin-left:200px;">
                                <li class="tit1"><label id="lblAeAddCount">@(dt2.Rows[0]["ALL_NURSE_NUM"].ToString())</label></li>
                                <li class="tit2">护士总数</li>
                            </ul>
                            <ul class="marginl125">
                                <li class="tit1"><label id="lblAeReviewCount">@(dt2.Rows[0]["ALL_LEAVE"].ToString())</label></li>
                                <li class="tit2">请假人数</li>
                            </ul>
                            <ul class="marginl125">
                                <li class="tit1">@(dt2.Rows[0]["ALL_WORK_NOW"].ToString())</li>
                                <li class="tit2">现岗人数</li>
                            </ul>
                        </div>
                    </div>
                </div>
                <div class="tabs" id="tabs3">
                    @*<div class="l-loading" style="display: block" id="pageloading"></div>*@
                    <div class="div1">
                        <div data-val="0" class="tab-date">当月</div>
                        <div data-val="1" class="tab-date">当季</div>
                        <div data-val="2" class="tab-date">当年</div>
                    </div>
                    <div class="hzhz div2" id="hzhz0" tabindex="0" style="display:none;">
                        <ul class="marginl50" style="margin-left:150px;">
                            <li class="tit1"><label id="lblALL_IN_MONTH"><img src="~/lib/images/loading.gif" width="32" height="32" /></label></li>
                            <li class="tit2">入院总数</li>
                        </ul>
                        <ul class="marginl125">
                            <li class="tit1"><label id="lblALL_OUT_MONTH"><img src="~/lib/images/loading.gif" width="32" height="32" /></label></li>
                            <li class="tit2">出院总数</li>
                        </ul>
                        <ul class="marginl125">
                            <li class="tit1"><label id="lblALL_TRAN_IN_MONTH"><img src="~/lib/images/loading.gif" width="32" height="32" /></label></li>
                            <li class="tit2">转入总数</li>
                        </ul>
                        <ul class="marginl125">
                            <li class="tit1"><label id="lblALL_TRAN_OUT_MONTH"><img src="~/lib/images/loading.gif" width="32" height="32" /></label></li>
                            <li class="tit2">转出总数</li>
                        </ul>
                    </div>
                    <div class="hzhz div2" id="hzhz1" tabindex="1" style="display:none;">
                        <ul class="marginl50" style="margin-left:150px;">
                            <li class="tit1"><label id="lblALL_IN_SEASON"><img src="~/lib/images/loading.gif" width="32" height="32" /></label></li>
                            <li class="tit2">入院总数</li>
                        </ul>
                        <ul class="marginl125">
                            <li class="tit1"><label id="lblALL_OUT_SEASON"><img src="~/lib/images/loading.gif" width="32" height="32" /></label></li>
                            <li class="tit2">出院总数</li>
                        </ul>
                        <ul class="marginl125">
                            <li class="tit1"><label id="lblALL_TRAN_IN_SEASON"><img src="~/lib/images/loading.gif" width="32" height="32" /></label></li>
                            <li class="tit2">转入总数</li>
                        </ul>
                        <ul class="marginl125">
                            <li class="tit1"><label id="lblALL_TRAN_OUT_SEASON"><img src="~/lib/images/loading.gif" width="32" height="32" /></label></li>
                            <li class="tit2">转出总数</li>
                        </ul>
                    </div>
                    <div class="hzhz div2" id="hzhz2" tabindex="2" style="display:none;">
                        <ul class="marginl50" style="margin-left:150px;">
                            <li class="tit1"><label id="lblALL_IN_YEAR"><img src="~/lib/images/loading.gif" width="32" height="32" /></label></li>
                            <li class="tit2">入院总数</li>
                        </ul>
                        <ul class="marginl125">
                            <li class="tit1"><label id="lblALL_OUT_YEAR"><img src="~/lib/images/loading.gif" width="32" height="32" /></label></li>
                            <li class="tit2">出院总数</li>
                        </ul>
                        <ul class="marginl125">
                            <li class="tit1"><label id="lblALL_TRAN_IN_YEAR"><img src="~/lib/images/loading.gif" width="32" height="32" /></label></li>
                            <li class="tit2">转入总数</li>
                        </ul>
                        <ul class="marginl125">
                            <li class="tit1"><label id="lblALL_TRAN_OUT_YEAR"><img src="~/lib/images/loading.gif" width="32" height="32" /></label></li>
                            <li class="tit2">转出总数</li>
                        </ul>
                    </div>
                </div>
                <div class="tabs" id="tabs4">
                    <div class="div2">
                        <ul class="marginl50" style="margin-left:150px;">
                            <li class="tit1">@(dtts.Rows[0]["ALL_DAY"].ToString())</li>
                            <li class="tit2">当日人数</li>
                        </ul>
                        <ul class="marginl125">
                            <li class="tit1">@(dtts.Rows[0]["ALL_MONTH"].ToString())</li>
                            <li class="tit2">当月人数</li>
                        </ul>
                        <ul class="marginl125">
                            <li class="tit1">@(dtts.Rows[0]["ALL_SEASON"].ToString())</li>
                            <li class="tit2">当季人数</li>
                        </ul>
                        <ul class="marginl125">
                            <li class="tit1">@(dtts.Rows[0]["ALL_YEAR"].ToString())</li>
                            <li class="tit2">当年人数</li>
                        </ul>
                    </div>
                </div>
                <div class="tabs" id="tabs5">
                    @*<div class="l-loading" style="display: block" id="pageloading"></div>*@
                    <div class="div1">
                        <div data-val="0" class="tab-date">当日</div>
                        <div data-val="1" class="tab-date">当月</div>
                        <div data-val="2" class="tab-date">当季</div>
                        <div data-val="3" class="tab-date">当年</div>
                    </div>
                    <div class="fxpg div2" id="fxpg0" tabindex="0" style="display: none; height: 130px">
                        <ul class="marginl50" style="margin-left:150px;" onclick="loadinfo(1,12001)">
                            <li class="tit1"><label>@(dtfxpg.Rows[0]["DAY_12001"].ToString())</label></li>
                            <li class="tit2">拔管风险</li>
                        </ul>
                        <ul class="marginl125" onclick="loadinfo(1,12003)">
                            <li class="tit1"><label>@(dtfxpg.Rows[0]["DAY_12003"].ToString())</label></li>
                            <li class="tit2">压疮风险</li>
                        </ul>
                        <ul class="marginl125" onclick="loadinfo(1,12004)">
                            <li class="tit1"><label>@(dtfxpg.Rows[0]["DAY_12004"].ToString())</label></li>
                            <li class="tit2">跌倒坠床风险</li>
                        </ul>
                        <ul class="marginl125" onclick="loadinfo(1,14001)">
                            <li class="tit1"><label>@(dtfxpg.Rows[0]["DAY_14001"].ToString())</label></li>
                            <li class="tit2">护理分级</li>
                        </ul>
                        <ul class="marginl125" style="margin-left: 152px" onclick="loadinfo(1,12009)">
                            <li class="tit1"><label>@(dtfxpg.Rows[0]["DAY_12009"].ToString())</label></li>
                            <li class="tit2">营养风险</li>
                        </ul>
                        <ul class="marginl125" style="margin-left: 110px" onclick="loadinfo(1,12006)">
                            <li class="tit1"><label>@(dtfxpg.Rows[0]["DAY_12006"].ToString())</label></li>
                            <li class="tit2">患儿跌倒风险</li>
                        </ul>
                        <ul class="marginl125" style="margin-left: 110px" onclick="loadinfo(1,12007)">
                            <li class="tit1"><label>@(dtfxpg.Rows[0]["DAY_12007"].ToString())</label></li>
                            <li class="tit2">患儿跌倒集束化</li>
                        </ul>
                    </div>
                    <div class="fxpg div2" id="fxpg1" tabindex="1" style="display: none; height: 130px">
                        <ul class="marginl50" style="margin-left:150px;" onclick="loadinfo(2,12001)">
                            <li class="tit1"><label>@(dtfxpg.Rows[0]["Mon_12001"].ToString())</label></li>
                            <li class="tit2">拔管风险</li>
                        </ul>
                        <ul class="marginl125" onclick="loadinfo(2,12003)">
                            <li class="tit1"><label>@(dtfxpg.Rows[0]["Mon_12003"].ToString())</label></li>
                            <li class="tit2">压疮风险</li>
                        </ul>
                        <ul class="marginl125" onclick="loadinfo(2,12004)">
                            <li class="tit1"><label>@(dtfxpg.Rows[0]["Mon_12004"].ToString())</label></li>
                            <li class="tit2">跌倒坠床风险</li>
                        </ul>
                        <ul class="marginl125" onclick="loadinfo(2,14001)">
                            <li class="tit1"><label>@(dtfxpg.Rows[0]["Mon_14001"].ToString())</label></li>
                            <li class="tit2">护理分级</li>
                        </ul>
                        <ul class="marginl125" style="margin-left: 152px" onclick="loadinfo(2,12009)">
                            <li class="tit1"><label>@(dtfxpg.Rows[0]["Mon_12009"].ToString())</label></li>
                            <li class="tit2">营养风险</li>
                        </ul>
                        <ul class="marginl125" style="margin-left: 110px" onclick="loadinfo(2,12006)">
                            <li class="tit1"><label>@(dtfxpg.Rows[0]["Mon_12006"].ToString())</label></li>
                            <li class="tit2">患儿跌倒风险</li>
                        </ul>
                        <ul class="marginl125" style="margin-left: 110px" onclick="loadinfo(2,12007)">
                            <li class="tit1"><label>@(dtfxpg.Rows[0]["Mon_12007"].ToString())</label></li>
                            <li class="tit2">患儿跌倒集束化</li>
                        </ul>
                    </div>
                    <div class="fxpg div2" id="fxpg2" tabindex="2" style="display: none; height: 130px">
                        <ul class="marginl50" style="margin-left:150px;" onclick="loadinfo(3,12001)">
                            <li class="tit1"><label>@(dtfxpg.Rows[0]["SEA_12001"].ToString())</label></li>
                            <li class="tit2">拔管风险</li>
                        </ul>
                        <ul class="marginl125" onclick="loadinfo(3,12003)">
                            <li class="tit1"><label>@(dtfxpg.Rows[0]["Sea_12003"].ToString())</label></li>
                            <li class="tit2">压疮风险</li>
                        </ul>
                        <ul class="marginl125" onclick="loadinfo(3,12004)">
                            <li class="tit1"><label>@(dtfxpg.Rows[0]["Sea_12004"].ToString())</label></li>
                            <li class="tit2">跌倒坠床风险</li>
                        </ul>
                        <ul class="marginl125" onclick="loadinfo(3,14001)">
                            <li class="tit1"><label>@(dtfxpg.Rows[0]["Sea_14001"].ToString())</label></li>
                            <li class="tit2">护理分级</li>
                        </ul>
                        <ul class="marginl125" style="margin-left: 152px">
                            <li class="tit1"><label>@(dtfxpg.Rows[0]["Sea_12009"].ToString())</label></li>
                            <li class="tit2">营养风险</li>
                        </ul>
                        <ul class="marginl125" style="margin-left: 110px" onclick="loadinfo(3,12006)">
                            <li class="tit1"><label>@(dtfxpg.Rows[0]["Sea_12006"].ToString())</label></li>
                            <li class="tit2">患儿跌倒风险</li>
                        </ul>
                        <ul class="marginl125" style="margin-left: 110px" onclick="loadinfo(3,12007)">
                            <li class="tit1"><label>@(dtfxpg.Rows[0]["Sea_12007"].ToString())</label></li>
                            <li class="tit2">患儿跌倒集束化</li>
                        </ul>
                    </div>
                    <div class="fxpg div2" id="fxpg3" tabindex="3" style="display: none; height: 130px">
                        <ul class="marginl50" style="margin-left:150px;" onclick="loadinfo(4,12001)">
                            <li class="tit1"><label>@(dtfxpg.Rows[0]["YEA_12001"].ToString())</label></li>
                            <li class="tit2">拔管风险</li>
                        </ul>
                        <ul class="marginl125" onclick="loadinfo(4,12003)">
                            <li class="tit1"><label>@(dtfxpg.Rows[0]["YEA_12003"].ToString())</label></li>
                            <li class="tit2">压疮风险</li>
                        </ul>
                        <ul class="marginl125" onclick="loadinfo(4,12004)">
                            <li class="tit1"><label>@(dtfxpg.Rows[0]["YEA_12004"].ToString())</label></li>
                            <li class="tit2">跌倒坠床风险</li>
                        </ul>
                        <ul class="marginl125" onclick="loadinfo(4,14001)">
                            <li class="tit1"><label>@(dtfxpg.Rows[0]["YEA_14001"].ToString())</label></li>
                            <li class="tit2">护理分级</li>
                        </ul>
                        <ul class="marginl125" style="margin-left: 152px" onclick="loadinfo(4,12009)">
                            <li class="tit1"><label>@(dtfxpg.Rows[0]["YEA_12009"].ToString())</label></li>
                            <li class="tit2">营养风险</li>
                        </ul>
                        <ul class="marginl125" style="margin-left: 110px" onclick="loadinfo(4,12006)">
                            <li class="tit1"><label>@(dtfxpg.Rows[0]["YEA_12006"].ToString())</label></li>
                            <li class="tit2">患儿跌倒风险</li>
                        </ul>
                        <ul class="marginl125" style="margin-left: 110px" onclick="loadinfo(4,12007)">
                            <li class="tit1"><label>@(dtfxpg.Rows[0]["YEA_12007"].ToString())</label></li>
                            <li class="tit2">患儿跌倒集束化</li>
                        </ul>
                    </div>
                    <div class="fxpg99 div2" id="fxpg99" tabindex="99" style="margin-top:10px;  height: 400px;display:block">
                        <!-- 为ECharts准备一个具备大小（宽高）的Dom -->
                        <div id="main2" style="width: 835px;height:400px;"></div>
                        <script type="text/javascript">
                            function loadinfo(dateType, formId) {
                                // 基于准备好的dom，初始化echarts实例
                                var myChart2 = echarts.init(document.getElementById('main2'));
                                myChart2.showLoading();  // 开启 loading 效果
                                var req_url = "/Main/GetRiskLevelGroupInfo?datetype=" + dateType + "&formid=" + formId;
                                $.get(req_url, function (data) {
                                    //alert("可以看到 loading 字样。"); // 测试代码，用于查看 loading 效果
                                    myChart2.hideLoading();  // 隐藏 loading 效果
                                    myChart2.setOption({
                                        series: [
                                            {
                                                name: '风险评估',
                                                type: 'pie',    // 设置图表类型为饼图
                                                radius: '55%',  // 饼图的半径，外半径为可视区尺寸（容器高宽中较小一项）的 55% 长度。
                                                data: data.data_pie
                                            }
                                        ]
                                    })
                                }, 'json');
                            }
                            //默认值 当日 拔管风险
                            loadinfo(1, 12001);
                        </script>
                    </div>
                </div>
                <div class="tabs" id="tabs6">
                    <div class="div1">
                        <div data-val="0" class="tab-date">当日</div>
                        <div data-val="1" class="tab-date">当月</div>
                        <div data-val="2" class="tab-date">当季</div>
                        <div data-val="3" class="tab-date">当年</div>
                    </div>
                    <div class="yyff div2" id="yyff0" tabindex="0" style="display: none; height: 130px">
                        <ul class="marginl50" style="margin-left: 55px">
                            <li class="tit1"><label id="lblAeAddCount">@(dtyyff.Rows[0]["DAY_吸痰用"].ToString())</label></li>
                            <li class="tit2">吸痰</li>
                        </ul>
                        <ul class="margin125" style="margin-left: 110px">
                            <li class="tit1"><label id="lblAeAddCount">@(dtyyff.Rows[0]["DAY_静滴"].ToString())</label></li>
                            <li class="tit2">静滴</li>
                        </ul>
                        <ul class="margin125" style="margin-left: 110px">
                            <li class="tit1"><label id="lblAeAddCount">@(dtyyff.Rows[0]["DAY_静推"].ToString())</label></li>
                            <li class="tit2">静推</li>
                        </ul>
                        <ul class="margin125" style="margin-left: 110px">
                            <li class="tit1"><label id="lblAeAddCount">@(dtyyff.Rows[0]["DAY_皮下"].ToString())</label></li>
                            <li class="tit2">皮下</li>
                        </ul>
                        <ul class="margin125" style="margin-left: 110px">
                            <li class="tit1"><label id="lblAeAddCount">@(dtyyff.Rows[0]["DAY_肌注"].ToString())</label></li>
                            <li class="tit2">肌注</li>
                        </ul>
                        <ul class="margin125" style="margin-left: 110px">
                            <li class="tit1"><label id="lblAeAddCount">@(dtyyff.Rows[0]["DAY_雾化"].ToString())</label></li>
                            <li class="tit2">雾化</li>
                        </ul>
                    </div>
                    <div class="yyff div2" id="yyff1" tabindex="1" style="display: none; height: 130px">
                        <ul class="marginl50" style="margin-left: 55px">
                            <li class="tit1"><label id="lblAeAddCount">@(dtyyff.Rows[0]["MON_吸痰用"].ToString())</label></li>
                            <li class="tit2">吸痰</li>
                        </ul>
                        <ul class="margin125" style="margin-left: 110px">
                            <li class="tit1"><label id="lblAeAddCount">@(dtyyff.Rows[0]["MON_静滴"].ToString())</label></li>
                            <li class="tit2">静滴</li>
                        </ul>
                        <ul class="margin125" style="margin-left: 110px">
                            <li class="tit1"><label id="lblAeAddCount">@(dtyyff.Rows[0]["MON_静推"].ToString())</label></li>
                            <li class="tit2">静推</li>
                        </ul>
                        <ul class="margin125" style="margin-left: 110px">
                            <li class="tit1"><label id="lblAeAddCount">@(dtyyff.Rows[0]["MON_皮下"].ToString())</label></li>
                            <li class="tit2">皮下</li>
                        </ul>
                        <ul class="margin125" style="margin-left: 110px">
                            <li class="tit1"><label id="lblAeAddCount">@(dtyyff.Rows[0]["MON_肌注"].ToString())</label></li>
                            <li class="tit2">肌注</li>
                        </ul>
                        <ul class="margin125" style="margin-left: 110px">
                            <li class="tit1"><label id="lblAeAddCount">@(dtyyff.Rows[0]["MON_雾化"].ToString())</label></li>
                            <li class="tit2">雾化</li>
                        </ul>
                    </div>
                    <div class="yyff div2" id="yyff2" tabindex="2" style="display: none; height: 130px">
                        <ul class="marginl50" style="margin-left: 55px">
                            <li class="tit1"><label id="lblAeAddCount">@(dtyyff.Rows[0]["SEA_吸痰用"].ToString())</label></li>
                            <li class="tit2">吸痰</li>
                        </ul>
                        <ul class="margin125" style="margin-left: 110px">
                            <li class="tit1"><label id="lblAeAddCount">@(dtyyff.Rows[0]["SEA_静滴"].ToString())</label></li>
                            <li class="tit2">静滴</li>
                        </ul>
                        <ul class="margin125" style="margin-left: 110px">
                            <li class="tit1"><label id="lblAeAddCount">@(dtyyff.Rows[0]["SEA_静推"].ToString())</label></li>
                            <li class="tit2">静推</li>
                        </ul>
                        <ul class="margin125" style="margin-left: 110px">
                            <li class="tit1"><label id="lblAeAddCount">@(dtyyff.Rows[0]["SEA_皮下"].ToString())</label></li>
                            <li class="tit2">皮下</li>
                        </ul>
                        <ul class="margin125" style="margin-left: 110px">
                            <li class="tit1"><label id="lblAeAddCount">@(dtyyff.Rows[0]["SEA_肌注"].ToString())</label></li>
                            <li class="tit2">肌注</li>
                        </ul>
                        <ul class="margin125" style="margin-left: 110px">
                            <li class="tit1"><label id="lblAeAddCount">@(dtyyff.Rows[0]["SEA_雾化"].ToString())</label></li>
                            <li class="tit2">雾化</li>
                        </ul>
                    </div>
                    <div class="yyff div2" id="yyff3" tabindex="3" style="display: none; height: 130px">
                        <ul class="marginl50" style="margin-left: 55px">
                            <li class="tit1"><label id="lblAeAddCount">@(dtyyff.Rows[0]["YEA_吸痰用"].ToString())</label></li>
                            <li class="tit2">吸痰</li>
                        </ul>
                        <ul class="margin125" style="margin-left: 110px">
                            <li class="tit1"><label id="lblAeAddCount">@(dtyyff.Rows[0]["YEA_静滴"].ToString())</label></li>
                            <li class="tit2">静滴</li>
                        </ul>
                        <ul class="margin125" style="margin-left: 110px">
                            <li class="tit1"><label id="lblAeAddCount">@(dtyyff.Rows[0]["YEA_静推"].ToString())</label></li>
                            <li class="tit2">静推</li>
                        </ul>
                        <ul class="margin125" style="margin-left: 110px">
                            <li class="tit1"><label id="lblAeAddCount">@(dtyyff.Rows[0]["YEA_皮下"].ToString())</label></li>
                            <li class="tit2">皮下</li>
                        </ul>
                        <ul class="margin125" style="margin-left: 110px">
                            <li class="tit1"><label id="lblAeAddCount">@(dtyyff.Rows[0]["YEA_肌注"].ToString())</label></li>
                            <li class="tit2">肌注</li>
                        </ul>
                        <ul class="margin125" style="margin-left: 110px">
                            <li class="tit1"><label id="lblAeAddCount">@(dtyyff.Rows[0]["YEA_雾化"].ToString())</label></li>
                            <li class="tit2">雾化</li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    <script>
        $(function () {
            GetPatientHistorySumInfo();
        });
        function GetPatientHistorySumInfo() {
            $.ajax({
                url: "/Main/GetPatientHistorySumInfo?ram" + Math.random(),
                type: "GET",
                data: {},
                timeout: 30000,
                success: function (data) {
                    var r = $.parseJSON(data);
                    if (r.Result == 1) {
                        var ALL_IN_MONTH = 0;
                        var ALL_OUT_MONTH = 0;
                        var ALL_TRAN_IN_MONTH = 0;
                        var ALL_TRAN_OUT_MONTH = 0;
                        var ALL_IN_SEASON = 0;
                        var ALL_OUT_SEASON = 0;
                        var ALL_TRAN_IN_SEASON = 0;
                        var ALL_TRAN_OUT_SEASON = 0;
                        var ALL_IN_YEAR = 0;
                        var ALL_OUT_YEAR = 0;
                        var ALL_TRAN_IN_YEAR = 0;
                        var ALL_TRAN_OUT_YEAR = 0;
                        var list = r.Body;
                        for (var i = 0; i < list.length; i++) {
                            ALL_IN_MONTH += parseInt(list[i].ALL_IN_MONTH);
                            ALL_OUT_MONTH += parseInt(list[i].ALL_OUT_MONTH);
                            ALL_TRAN_IN_MONTH += parseInt(list[i].ALL_TRAN_IN_MONTH);
                            ALL_TRAN_OUT_MONTH += parseInt(list[i].ALL_TRAN_OUT_MONTH);
                            ALL_IN_SEASON += parseInt(list[i].ALL_IN_SEASON);
                            ALL_OUT_SEASON += parseInt(list[i].ALL_OUT_SEASON);
                            ALL_TRAN_IN_SEASON += parseInt(list[i].ALL_TRAN_IN_SEASON);
                            ALL_TRAN_OUT_SEASON += parseInt(list[i].ALL_TRAN_OUT_SEASON);
                            ALL_IN_YEAR += parseInt(list[i].ALL_IN_YEAR);
                            ALL_OUT_YEAR += parseInt(list[i].ALL_OUT_YEAR);
                            ALL_TRAN_IN_YEAR += parseInt(list[i].ALL_TRAN_IN_YEAR);
                            ALL_TRAN_OUT_YEAR += parseInt(list[i].ALL_TRAN_OUT_YEAR);
                        }
                        $("#lblALL_IN_MONTH").text(ALL_IN_MONTH);
                        $("#lblALL_OUT_MONTH").text(ALL_OUT_MONTH);
                        $("#lblALL_TRAN_IN_MONTH").text(ALL_TRAN_IN_MONTH);
                        $("#lblALL_TRAN_OUT_MONTH").text(ALL_TRAN_OUT_MONTH);
                        $("#lblALL_IN_SEASON").text(ALL_IN_SEASON);
                        $("#lblALL_OUT_SEASON").text(ALL_OUT_SEASON);
                        $("#lblALL_TRAN_IN_SEASON").text(ALL_TRAN_IN_SEASON);
                        $("#lblALL_TRAN_OUT_SEASON").text(ALL_TRAN_OUT_SEASON);
                        $("#lblALL_IN_YEAR").text(ALL_IN_YEAR);
                        $("#lblALL_OUT_YEAR").text(ALL_OUT_YEAR);
                        $("#lblALL_TRAN_IN_YEAR").text(ALL_TRAN_IN_YEAR);
                        $("#lblALL_TRAN_OUT_YEAR").text(ALL_TRAN_OUT_YEAR);
                    }
                    else if (r.Result == 0) {
                        //$.ligerDialog.error("服务器繁忙，请稍后再试");
                    }
                    else {
                        $.ligerDialog.error("程序错误");
                    }
                }
            });
        }
        $(function () {
            var result = { "Code": 1, "D": { "title": "", "xAxisTitle": "病区", "yAxisTitle": "患者数", "legendData": [""], "seriesData": [@Html.Raw(patientsArray)], "xAxisData": [@Html.Raw(nurseCellArray)] } };
            var data = result.D;
            var legendData = data.legendData;
            var seriesData = [];
            for (var i = 0; i < legendData.length; i++) {
                var tempData = [];
                for (var ii = 0; ii < data.seriesData.length; ii++) {
                    if (legendData[i] == data.seriesData[ii].name) {
                        tempData.push(data.seriesData[ii].value);
                    }
                }
                seriesData.push(tempData);
            }
            var title = data.title;
            var xAxisData = data.xAxisData;
            var xAxisTitle = data.xAxisTitle;
            var yAxisTitle = data.yAxisTitle;
            SetBar(title, xAxisTitle, yAxisTitle, legendData, seriesData, xAxisData);
        });
        function SetBar(title, xAxisTitle, yAxisTitle, legendData, seriesData, xAxisData) {
            var count = xAxisData.length;
            var girdWidth = $(window).width() - 125;
            var zoomEnd = 100;
            if (girdWidth / 20 < count) {
                zoomEnd = Math.floor(girdWidth / 25 / count * 100);
            }

            var extraHeight = $(window).height() - 490;
            if (extraHeight > 250) {
                extraHeight = 250;
            }
            var yAxisMax = Math.max.apply(null, seriesData[0]);
            var gridHeight = 140;
            var splitNumber = 5;
            var interval = Math.ceil(yAxisMax / splitNumber);
            var tempInterval = interval;

            if (extraHeight > 0) {
                gridHeight += extraHeight;
                splitNumber += Math.floor(extraHeight / 50);
                $("#mainecharts").height($("#mainecharts").height() + extraHeight);
            }
            for (var i = 1; i <= 1000; i++) {
                if (tempInterval % Math.pow(10, interval.toString().length - 1) == 0) {
                    break;
                }
                tempInterval++;
            }
            yAxisMax = splitNumber * tempInterval;

            var series = [];
            for (var i = 0; i < legendData.length; i++) {
                series.push({
                    name: legendData[i],
                    type: 'bar',
                    barWidth: 10,
                    data: seriesData[i]
                })
            }
            var myChart = echarts.init(document.getElementById('mainecharts'));
            option = {
                color: ['#88D3E2'],
                tooltip: {
                    trigger: 'axis',
                    axisPointer: {
                        type: 'shadow'
                    }
                },
                grid: {
                    y: 40,
                    y2: 100,
                    x: 40,
                    x2: 80,
                    height: gridHeight
                },
                xAxis: [
                    {
                        boundaryGap: true,
                        axisLabel: {
                            interval: 0,
                            rotate: -40
                        },
                        type: 'category',
                        data: xAxisData,
                        axisTick: {
                            alignWithLabel: true
                        },
                        name: xAxisTitle
                    }
                ],
                yAxis: [
                    {
                        type: 'value',
                        name: yAxisTitle,
                        min: 0,
                        max: yAxisMax,
                        splitNumber: splitNumber
                    }
                ],
                series: series,
                dataZoom: [//给x轴设置滚动条
                   {
                       start: 0,//默认为0
                       end: zoomEnd,//默认为100
                       type: 'slider',
                       show: zoomEnd == 100 ? false : true,
                       xAxisIndex: [0],
                       handleSize: 0,//滑动条的 左右2个滑动条的大小
                       height: 10,//组件高度
                       left: '10', //左边的距离
                       right: '20',//右边的距离
                       bottom: '0',//下边的距离
                       borderColor: "#fff",
                       fillerColor: '#6698A2',
                       borderRadius: 5,
                       backgroundColor: '#D4E3E6',//两边未选中的滑动条区域的颜色
                       showDataShadow: false,//是否显示数据阴影 默认auto
                       showDetail: false,//即拖拽时候是否显示详细数值信息 默认true
                       realtime: true, //是否实时更新
                       filterMode: 'filter'
                   }
                ]
            };
            myChart.setOption(option);
        }
        </script>
</body>
</html>